package code.schema

import org.squeryl.{KeyedEntity, KeyedEntityDef, PrimitiveTypeMode}

object SquerylEntrypoint extends PrimitiveTypeMode {
  override implicit def kedForKeyedEntities[A, K](implicit ev: A <:< KeyedEntity[K], m: Manifest[A]): KeyedEntityDef[A, K] = new KeyedEntityDef[A, K] {
    def getId(a: A) = a.id

    def isPersisted(a: A) = a.isPersisted

    def idPropertyName = "id"
  }
}
